package com.cloud.util.base;

/**
 * Json通用返回类
 * @author gaof
 * @date 2016年4月17日
 */
public class RetType {

	/**
	 * 未登录标识
	 */
	public static final String RET_NO_LOGIN = "0";
	
	/**
	 * 成功标识
	 */
	public static final String RET_SUCCESS = "1";
	
	/**
	 * 失败标识
	 */
	public static final String RET_FAILE = "2";
	
	private String errCode;
	
	private String errMsg;
	
	private Object data;
	
	/**
	 * 返回错误
	 * @param msg
	 */
	public void doError(String msg){
		this.errCode = this.RET_FAILE;
		this.errMsg = msg;
	}
	
	/**
	 * 返回成功
	 */
	public void doSuccess(){
		this.errCode = this.RET_SUCCESS;
	}
	
	/**
	 * 返回成功
	 */
	public void doSuccess(Object data){
		this.errCode = this.RET_SUCCESS;
		this.data = data;
	}

	public String getErrCode() {
		return errCode;
	}

	public void setErrCode(String errCode) {
		this.errCode = errCode;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	
	
}
